
#include <QVariantList>

#include "./ui_widget.h"
#include "widget.h"

Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::Widget)
{
    ui->setupUi(this);
    ui->tableWidget->setShape(0, 2);

    connect(ui->btnAdd, &QPushButton::clicked, //
            [=]() { ui->tableWidget->addRecord(QVariantList()); });

    connect(ui->btnInsert, &QPushButton::clicked, //
            [=]() { ui->tableWidget->insertRecord(QVariantList()); });

    connect(ui->btnDel, &QPushButton::clicked, //
            [=]() { ui->tableWidget->deleteSelectedRows(); });

    connect(ui->btnImport, &QPushButton::clicked, //
            [=]() { ui->tableWidget->importContent(); });

    connect(ui->btnExport, &QPushButton::clicked, //
            [=]() { ui->tableWidget->exportContent(); });
}

Widget::~Widget()
{
    delete ui;
}
